how do i modify this awk-script? It is modifying every occurrence but should modify every occurrence except in one column. The big problem is, that the specific column is not always the first one. But i know the Name of the column in the header.
awk '
BEGIN{
  FS=OFS=","
}
FNR==1{
  print
  next
}
{
  for(i=1;i<=NF;i++){
    sub(/^\/Text[0-9]+Text/,"",$i)
    sub(/Text.*/,"",$i)
  }
}
1
'  Input_file
Explanation: Adding a detailed level of explanation of above code:
awk '
BEGIN{                                 ##Starting BEGIN section of code here.
  FS=OFS=","                           ##Setting FS and OFS to comma here.
}
FNR==1{                                ##Checking condition if FNR==1 then do following.
  print                                ##Printing the current line here.
  next                                 ##next will skip all further statements from here.
}
{
  for(i=1;i<=NF;i++){                  ##Starting a for loop to traverse into all fields here.
    sub(/^\/Text[0-9]+Text/,"",$i)     ##Substituting from starting Text digits Text with NULL in current field.
    sub(/Text.*/,"",$i)                ##Substituting everything from Text to till last of field value with NULL in current field.
  }
}
1                                      ##1 will print edited/non-edited line here.
'  Input_file                          ##Mentioning Input_file name here.
Examplefile:
header1, header2, header3-dont-modify-this-column, header4, header5
,,/Text2234Text7846641Text.html,/Text2234Text7846641Text.html,/Text2234Text823241Text.html
,,/Text2234Text7846642Text.html,/Text2234Text7846642Text.html,/Text2234Text823242Text.html
,,/Text2234Text7846643Text.html,/Text2234Text7846643Text.html,/Text2234Text823243Text.html
Result should be:
header1, header2, header3-dont-modify-this-column, header4, header5
,,/Text2234Text7846641Text.html,7846641,823241
,,/Text2234Text7846642Text.html,7846642,823242
,,/Text2234Text7846643Text.html,7846643,823243
Thank you
 
     
     
    