Hello All,
I have a .CSV file where I expect all numeric data in all the columns other than column headers.
But sometimes I get the files (result of statistics computation by other persons) like below( sample data)
Code:
SNO,Data1,Data2,Data3
1,2,3,4
2,3,4,SOME STRING
3,4,Inf,5
4,5,4,4
I want to remove the columns where ever character strings( I cannot provide the complete list as it is
Given columned text in a file that is delimited by a certain character, how do you truncate the width of either a specific column(s) or all columns?
The use case is that I am reading some log files that have space delimited columns. Some of the columns in the log are very long urls that make the file difficult to read.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Hi guys, i'm a new guy here, and it's my first time creating a unix script.
can you guys help me out here? i'd really appreciate it.
Hi,
I have a space delimited text file with multiple columns 102 columns. I want to break it up into 100 files labelled 1.txt through 100.txt (n.txt). Each text file will contain the first two columns and in addition the nth column (that corresponds to n.txt). The third file will contain the first three columns and the fourth file will contain columns 1,2 and 4 and so on.
Hi group,
Can you please tell how to delete specific columns from a file.
I know something like
Code:
awk -F, '{ print $1" "$2" "15 }' input.txt > output.txt
will delete all other columns. But this is in a way to copy some particular columns.
But is there any other way to select just some columns to delete?
Thanks
Mitra
Hi all,
For no particular reason, I would like to use awk on a file that contains multiple columns, but let's say only columns 1 and 2 have some text values, and the remainder of the line contains text that I would like to treat as one column, considering I have spaces as delimiter for the columns, e.g.:
Code:
alpha 200 this is a comment for this record
bravo 400 this is another comment for
Hi,
I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt.
Below is a bash shell script for taking in a csv file and spitting out rows formatted the way I want (Some more changes are there, but I only kept the array affecting ones below to show).
FILENAME=$1
cat $FILENAME | while read LINE
do
OIFS=$IFS;
IFS=","
columns=( $LINE )
date=${columns[4]//\"/}
columns[13]=${columns[13]//\"/}
columns[4]=$(date -d $date +%s)
newline=${c
Hi all
I have following kind of data in a file but non separated
Code:
ESR1 PA156 leflunomide PA450192
CHST3 PA26503 docetaxel tungstate Pa4586; thalidomide Pa34958;
I want to separate entries into columns so that I can put into excel sheet in proper arrangement.
I want entries starting PAxxx/PAxxxx in a columns
so that for first row I will have entries arra