3 added 1 character in body
source | link

Using awk:

awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print }' input

This will split the 4th column by whitespace and then set it to the first element.


Should work regardless of what is in the 4th column:

$ cat input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George Armani;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test name;somewhere

$ awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print }' input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test;somewhere

Using awk:

awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input

This will split the 4th column by whitespace and then set it to the first element.


Should work regardless of what is in the 4th column:

$ cat input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George Armani;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test name;somewhere

$ awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test;somewhere

Using awk:

awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print }' input

This will split the 4th column by whitespace and then set it to the first element.


Should work regardless of what is in the 4th column:

$ cat input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George Armani;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test name;somewhere

$ awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print }' input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test;somewhere
2 deleted 18 characters in body
source | link

Using awk:

awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input

This will split the 4th column by whitespace and then set it to the first element of the whitespace.


Should work regardless of what is in the 4th column:

$ cat input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George Armani;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test name;somewhere

$ awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test;somewhere

Using awk:

awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input

This will split the 4th column by whitespace and then set it to the first element of the whitespace.


Should work regardless of what is in the 4th column:

$ cat input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George Armani;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test name;somewhere

$ awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test;somewhere

Using awk:

awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input

This will split the 4th column by whitespace and then set it to the first element.


Should work regardless of what is in the 4th column:

$ cat input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George Armani;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test name;somewhere

$ awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test;somewhere
1
source | link

Using awk:

awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input

This will split the 4th column by whitespace and then set it to the first element of the whitespace.


Should work regardless of what is in the 4th column:

$ cat input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George Armani;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test name;somewhere

$ awk -F\; 'OFS = ";"{ if ($4 ~ " "); split($4, fname, / /); $4=fname[1]; print}' input
Date;Time;Brand;User;Node;Location
01/01/01;666;blabla;George;Springfield
02/02/02;777;blabla;Jesse_b;South Park
03/03/03;888;blabla;test;somewhere