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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

whitespace at the beginning of line

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Hallo all,

Could someone quickly refresh my tired mind please.

I have two lines that look like:

First Name: John
Last Name: Doe


and I would like to merge that to one line <name>John Doe</name>.

/^ First Name/ { gsub(/&/,"and") pr(); first = $2 ; next }
/^ Last Name/ { pr(); $0 = "<name>" first " " $2 "</name>"
print; next}


but I only get this result

<name> </name>

What am I missing here?
 
Never mind...

I had a wrongly defined FS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top