Hi everybody,
I have a file (a.dat) with the following data in it :
10/17/2003^F^555555^F^333^F^HELLO^F^04-15-2003^R^
10/17/2003^F^444444^F^11^F^^F^09-15-2003^R^
10/17/2003^F^555555^F^333^F^WATER^F^04-15-2003^R^
10/17/2003^F^^F^333^F^FIRE^F^04-15-2003^R^
10/17/2003^F^111^F^333^F^WIND^F^04-15-2003^R^
....
Based on the field number given by the user I need to delete the field from all lines in the file and output it to another file. For example if the user input is "a.dat 3" (which means user wants 3rd field to be deleted from file a.dat) then my output should be
10/17/2003^F^555555^FHELLO^F^04-15-2003^R^
10/17/2003^F^444444^F^^F^09-15-2003^R^
10/17/2003^F^555555^F^WATER^F^04-15-2003^R^
10/17/2003^F^^F^FIRE^F^04-15-2003^R^
10/17/2003^F^111^F^WIND^F^04-15-2003^R^
....
Could you please help me with a script to do this. Thanks.
I have a file (a.dat) with the following data in it :
10/17/2003^F^555555^F^333^F^HELLO^F^04-15-2003^R^
10/17/2003^F^444444^F^11^F^^F^09-15-2003^R^
10/17/2003^F^555555^F^333^F^WATER^F^04-15-2003^R^
10/17/2003^F^^F^333^F^FIRE^F^04-15-2003^R^
10/17/2003^F^111^F^333^F^WIND^F^04-15-2003^R^
....
Based on the field number given by the user I need to delete the field from all lines in the file and output it to another file. For example if the user input is "a.dat 3" (which means user wants 3rd field to be deleted from file a.dat) then my output should be
10/17/2003^F^555555^FHELLO^F^04-15-2003^R^
10/17/2003^F^444444^F^^F^09-15-2003^R^
10/17/2003^F^555555^F^WATER^F^04-15-2003^R^
10/17/2003^F^^F^FIRE^F^04-15-2003^R^
10/17/2003^F^111^F^WIND^F^04-15-2003^R^
....
Could you please help me with a script to do this. Thanks.