Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264
remove thanks, formatting.
Source Link

I'veI have the following situation: A

A csv with users names and another Value (something like a serial number)

Test; User; WKCVW432994; ; ;
Test; Users; Middlename; WEJDFH34992; ;
Test; Some; Weird; Guy; WEFDJJ23453;
Test; Some; Even; Weirder; Guy; WEFDJJ23453

What I exactly need is to omit the delimiters and paste in a static value behind the name and before the serial number -, like that:

Test User StaticValue WKCVW432994
Test Users StaticValue Middlename StaticValue WEJDFH34992
Test Some Weird Guy StaticValue WEFDJJ23453
Test Some Even Weirder Guy StaticValue WEFDJJ23453

I already got it managed for the guys with one fore and one surname:

awk -F";" '{k=$3; $3="StaticValue"; $4=k OFS $(NF--); print}' in.csv > out.csv

The difference between the name length / number of cells for the complete name I need is my problem at the moment...

Thanks for your help :)

I've the following situation: A csv with users names and another Value (something like a serial number)

Test; User; WKCVW432994; ; ;
Test; Users; Middlename; WEJDFH34992; ;
Test; Some; Weird; Guy; WEFDJJ23453;
Test; Some; Even; Weirder; Guy; WEFDJJ23453

What I exactly need is to omit the delimiters and paste in a static value behind the name and before the serial number - like that:

Test User StaticValue WKCVW432994
Test Users StaticValue Middlename WEJDFH34992
Test Some Weird Guy StaticValue WEFDJJ23453
Test Some Even Weirder Guy StaticValue WEFDJJ23453

I already got it managed for the guys with one fore and one surname:

awk -F";" '{k=$3; $3="StaticValue"; $4=k OFS $(NF--); print}' in.csv > out.csv

The difference between the name length / number of cells for the complete name I need is my problem at the moment...

Thanks for your help :)

I have the following situation:

A csv with users names and another Value (something like a serial number)

Test; User; WKCVW432994; ; ;
Test; Users; Middlename; WEJDFH34992; ;
Test; Some; Weird; Guy; WEFDJJ23453;
Test; Some; Even; Weirder; Guy; WEFDJJ23453

What I exactly need is to omit the delimiters and paste in a static value behind the name and before the serial number, like:

Test User StaticValue WKCVW432994
Test Users Middlename StaticValue WEJDFH34992
Test Some Weird Guy StaticValue WEFDJJ23453
Test Some Even Weirder Guy StaticValue WEFDJJ23453

I already got it managed for the guys with one fore and one surname:

awk -F";" '{k=$3; $3="StaticValue"; $4=k OFS $(NF--); print}' in.csv > out.csv

The difference between the name length / number of cells for the complete name I need is my problem at the moment.

Source Link

CSV Format output

I've the following situation: A csv with users names and another Value (something like a serial number)

Test; User; WKCVW432994; ; ;
Test; Users; Middlename; WEJDFH34992; ;
Test; Some; Weird; Guy; WEFDJJ23453;
Test; Some; Even; Weirder; Guy; WEFDJJ23453

What I exactly need is to omit the delimiters and paste in a static value behind the name and before the serial number - like that:

Test User StaticValue WKCVW432994
Test Users StaticValue Middlename WEJDFH34992
Test Some Weird Guy StaticValue WEFDJJ23453
Test Some Even Weirder Guy StaticValue WEFDJJ23453

I already got it managed for the guys with one fore and one surname:

awk -F";" '{k=$3; $3="StaticValue"; $4=k OFS $(NF--); print}' in.csv > out.csv

The difference between the name length / number of cells for the complete name I need is my problem at the moment...

Thanks for your help :)