Quote:
|
Originally Posted by irehman
I'm new to unix scripting
I have a file with thousands of rows, each row starts with a transaction code such as H1012, H1013, T7890, M678N. Each Transaction code is always 5 letter long. I need to extract all the rows starting from U1012 and write the output to another file.
How do I do that?
Thanks in Advance
|
Two interpretations for the above questions.
Extract all rows starting from txn code U1012 till end of file.
Code:
sed -n -e '/^U1012/,$p' input.txt > output.txt
Or, get all txn rows like U1012, U1013 et al. i.e. all U txn rows.
Code:
sed -n -e '/^U.*/p' input.txt > output.txt