Search Results

Search: Posts Made By: nithins007
4,948
Posted By ahamed101
OP wanted everyline to be printed right? awk...
OP wanted everyline to be printed right?

awk 'BEGIN{FS="*"; OFS="*"} /^ABC/{$7="13"}1' input_file


BTW, 1 here is WHENTOPRINT which is true and prints everything by default.

--ahamed
4,948
Posted By Corona688
That looks like a fine illustration of awk's...
That looks like a fine illustration of awk's basic principles actually :) I'll just comment it a bit more:

# awk code blocks work like CONDITION { code } WHENTOPRINT
# For each line, { code }...
6,602
Posted By Scrutinizer
Hi, try this: awk -F\|...
Hi, try this:
awk -F\| '{n=$1"_xyz.dat"}f!=n{close(f);f=n}{print>f}' file
6,602
Posted By itkamaraj
awk -F\| '{print > $1"_xyz.dat"}'...
awk -F\| '{print > $1"_xyz.dat"}' inputfile
7,849
Posted By Scott
There's no need to resubmit your post. But you...
There's no need to resubmit your post. But you also don't need so many, especially bright, colours - red-blue-red-blue-red would work for me!

Now, if you had used code tags...
7,849
Posted By Scrutinizer
Hi, see if this works: sed...
Hi, see if this works:
sed '$d;s/.......\(....\).\(..\)\(...\)...\(...\)....\(...\).*/\1|\2|\3||x|\4|0\n\1|\2|\3||y|0|\5/' infile2345|98|809||x|969|0
2345|98|809||y|0|537
2345|97|809||x|544|0...
14,708
Posted By danmero
awk 'BEGIN{FS=OFS="|"}{y=$6!=x?0:y;x=$6}$5=++y'...
awk 'BEGIN{FS=OFS="|"}{y=$6!=x?0:y;x=$6}$5=++y' file
14,708
Posted By danmero
awk -F\| '$5=NR' OFS=\| file
awk -F\| '$5=NR' OFS=\| file
14,708
Posted By bartus11
Try: awk -F\| -vOFS=\| '{$5=NR}1' file
Try: awk -F\| -vOFS=\| '{$5=NR}1' file
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 09:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy