Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
field sperating with awk
Name: salem Date: January 7, 2007 at 20:10:37 Pacific OS: hpux CPU/Ram: 4GB Product: hp9000
Above, I set Field Separator to either a dot or a space. But one warning: The default field separation of white space allows any number of consecutive spaces/tabs to count as a single separator. But when setting FS like this, multiple consecutive spaces will be taken as multiple separators, so this can mess you up with additional null fields.
And that is why I did not use the quotes on my echo command. The presence of quotes would preserve the extra spaces, but without the quotes, echo will output each operand with only one space between.
0
Response Number 4
Name: salem Date: January 12, 2007 at 07:27:26 Pacific
Summary: Hi, I am trying to use the printf with awk to send some data to print. Here is the statement in my script: echo "$i $state $q_date $project $title" | awk '{ printf "%-11s%-2s%-7s%-17s%-60s\n", $1, $2,...
Summary: I have a txt file with description of many different variables, smt like: "....... $Start_engine -- starting engine $Kill_process -- kills a process $Find_Gates_and_kill_him -- search for a windows pc...
Summary: Dear all, How I can find the number of line(that my string exists) with awk or sed (not grep). for example :(my file) xxxxaaaxxxx rrrrrrrrrrrrrrrrrr xxxxbbbbbxxxx zzzzzaaazzzzz zzzzzbbbbbzzzz I want ...