![]() |
script to get a part of line from a file
Hello
I have a directory of several text files formatted as follwoing [25.8376] [32.1000] B: xab~ir $uw fiy Eindak >axbaAr [2.8376] [12.1000] B: xab $uw Gde Ginda >qwaAd [100.8376] [200.1000] A: xab~ir $gd fhg Qwerak AssbaAr . it appears that it has three parts seperated by \t tab,I want to get only the last part (red) of line and so on for whole file then all files putting them in one file as output file formated as a words seperated by spaces would you please help me to write a script to do that ?? thanx a lot MD |
Code:
sed 's/^.*\t//' filename(s) > file to save to |
Code:
awk 'BEGIN{FS=": "}{ print $2 }' file* > outfile |
Quote:
thank you its running |
Quote:
but It doesnt result out ! |
Quote:
Code:
# awk 'BEGIN{FS=": "}{ print $2 }' file |
Hi,
@ghostdog74: Shouldn't this: FS=": " be FS=":\t" The OP stated that fields are tab separated. |
Quote:
exactly !!! thank you all |
| All times are GMT -5. The time now is 07:29 PM. |