Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for help on awk. 1

Status
Not open for further replies.

kttan84

Vendor
Jan 19, 2016
10
MY
Looking for help.

input file:
"1V2_FPGA"
"GNDD"
"CPU_VCCINT"
"V_SW1"
"V_SW2"

i'm need output as:
short "GNDD" to "1V2_FPGA"
short "CPU_VCCINT" to "1V2_FPGA"
short "V_SW1" to "1V2_FPGA"
short "V_SW2" to "1V2_FPGA"

request help with syntax explanation.
hopefully can make the 1st line as a variable methode.



 
Hi

Code:
NR [teal]==[/teal] [purple]1[/purple] [teal]{[/teal]                        [gray]# if processing the 1[sup]st[/sup] record[/gray]
    f [teal]=[/teal] [navy]$0[/navy]                       [gray]# save its value in a variable[/gray]
    [b]next[/b]                         [gray]# skip the rest of code for this record, so...[/gray]
[teal]}[/teal]

[teal]{[/teal]                                [gray]# ... this will be reached only starting with 2[sup]nd[/sup] record[/gray]
    [b]print[/b] [i][green]"short "[/green][/i] [navy]$0[/navy] [i][green]" to "[/green][/i] f   [gray]# output the text including current record and 1[sup]st[/sup] record's saved value[/gray]
[teal]}[/teal]

Feherke.
feherke.ga
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top