Hello,
I need help with writing a script that will open a dat file in my temp directory and then check a specific column's field "USER_ID". if the column USER_ID field is more than 6 characters I would then need the script to trim from the RIGHT of the "USER_ID' column to be within the 6 character limit. If the column is within the 6 Character limit, I need the script to do nothing. Additionally, the filename of the file in my temp file is never the same name so I would need the script to just look for and read from the .dat file.
"c:\Temp\sattransfers012014.dat"
"RECORDID"!"DATE"!"Status"!"USER_ID"!"LOCATION"
"34565"!"20140917"!"Online"!"cranberrydo"!"SANDIEGO"
"42344"!"20140912"!"Online"!"cranberrydo"!"SANDIEGO"
"34344"!"20140514"!"Online"!"cranberrydo"!"SANDIEGO"
"RECORDID"!"DATE"!"Status"!"USER_ID"!"LOCATION"
"34565"!"20140917"!"Online"!"cranbe"!"SANDIEGO"
"42344"!"20140912"!"Online"!"cranbe"!"SANDIEGO"
"34344"!"20140514"!"Online"!"cranbe"!"SANDIEGO"
Any assistance is greatly appreciated.
I need help with writing a script that will open a dat file in my temp directory and then check a specific column's field "USER_ID". if the column USER_ID field is more than 6 characters I would then need the script to trim from the RIGHT of the "USER_ID' column to be within the 6 character limit. If the column is within the 6 Character limit, I need the script to do nothing. Additionally, the filename of the file in my temp file is never the same name so I would need the script to just look for and read from the .dat file.
"c:\Temp\sattransfers012014.dat"
"RECORDID"!"DATE"!"Status"!"USER_ID"!"LOCATION"
"34565"!"20140917"!"Online"!"cranberrydo"!"SANDIEGO"
"42344"!"20140912"!"Online"!"cranberrydo"!"SANDIEGO"
"34344"!"20140514"!"Online"!"cranberrydo"!"SANDIEGO"
"RECORDID"!"DATE"!"Status"!"USER_ID"!"LOCATION"
"34565"!"20140917"!"Online"!"cranbe"!"SANDIEGO"
"42344"!"20140912"!"Online"!"cranbe"!"SANDIEGO"
"34344"!"20140514"!"Online"!"cranbe"!"SANDIEGO"
Any assistance is greatly appreciated.