i have text file with encoding utf8-le with name W12*.txt in current folder, contain 500…
- User
i have text file with encoding utf8-le with name W12*.txt in current folder, contain 500 or more record, and 77 columns separated by tab, name of files ex: W1275735100140308.txt, all of filename theme same length, i need 8th to 11th character in this ex: 5100 i need code to generate 1 csv file contain: column 6, column 7, column 39 and column to [8th to 11th character of filename]: bash code with bulit-in tools macos.
- Assistant
You can achieve this using a combination of Bash commands such as
awkto process the text file and extract the necessary columns. Below is a simple script that does this for the specified.txtfiles:bash - User
i have text file with encoding utf-16le with name W12*.txt in current folder, contain 500 or more record, and 77 columns separated by tab, name of files ex: W1275735100140308.txt, all of filename theme same length, i need 8th to 11th character in this ex: 5100 i need code to generate 1 csv file contain: column 6, column 7, column 39 and column to [8th to 11th character of filename]: bash code with bulit-in tools macos.
- Assistant
To process a UTF-16LE encoded text file in Bash on macOS, you can use the
iconvcommand to convert the file to UTF-8, and then useawkto extract the desired fields. Here's a script that accomplishes this:bash - User
i have text file with encoding utf-16le with name W12*.txt in current folder, contain 500 or more record, and 77 columns separated by tab, name of files ex: W1275735100140308.txt, all of filename theme same length, i need 8th to 11th character in this ex: 5100 i need code to generate 1 csv file contain: column 6, column 7, column 39 and column to [8th to 11th character of filename]: commandline code with bulit-in tools in windows.
- Assistant