General :: Determine Number Of Rows And Columns Of File In Shell?
Mar 4, 2010
if there's a tab-delimited file under /usr/desktop, how can I determine the number of rows and columns of the file in shell?And, if told the the 3rd column of the file contains only numerical values and all values in the 5th column are unique, how can I verify these in shell?
View 13 Replies
ADVERTISEMENT
Jul 18, 2011
In linux terminal; how can we get the number of rows ad columns from linux kernel? I tried from environment variables(LINES,COLUMNS) but, I could not retrieve them as my editor program is a child process to linux terminal process.
View 7 Replies
View Related
Oct 8, 2010
I need to write shell script which can take number of files and count total rows from all CSVs and display total number of rows counted in all files. Is there any possibility of doing that using shell script and if yes then how.
View 4 Replies
View Related
Jul 29, 2011
I would like to transform rows into columns from a file in bash.
View 4 Replies
View Related
Aug 27, 2010
I have been messing with a2ps in order to print a text file I have that has 130 columns by 80 rows per page. It appears that a2ps automatically scales the number of rows based upon the number of columns I try to print.The file prints properly for the columns but a2ps scales the rows to be 97 rows per page. So the 80 rows print but the next 17 rows are blank. It is not scaling the font for for 80 rows.
View 1 Replies
View Related
Aug 10, 2009
I bet this is a Perl one-liner (or very simple python script).I have a tab separated files in which each row looks like:Unique_Eight_Character_Sequence [3 tabs] data1~moredata1~moredata1 [3 tabs] data2~ moredata2~ moredata2 ... dataN~.The output file should have each column converted into a row (with the unique character sequence copied in for the first column), and then each "~" replaced by a comma.
View 14 Replies
View Related
Jun 28, 2010
I need to create an out put file, last two columns as a row of data (using the first columns as heading) with the file name as first row. For an example the out put file should look like; system_name,0900_in,1000_in,1100_in,1200_in,1300_in,1400_in,0900_out,1000_out,1100_out,1200_out,1300 _out,1400_out
system1,15,17,19,21,23,25,24,26,28,30,32,34
I need to run a script to do above conversion. Need your help.
View 3 Replies
View Related
May 26, 2011
I've been hitting my head against a wall for awhile with this one:As the last part of some data analysis I performing I would to construct a matrix from a series of different files. These files have the format:
file 1 file 2 file 3
AAAAA .1 AAAAA .1 BBBBB .1
BBBBB .2 BBBBB .1 CCCCC .9
[code]...
View 6 Replies
View Related
Apr 18, 2011
Does anyone have a solution for merging files if the number of rows in the two (or more) files is non-equivalent.To exemplify, how about merging the following 3 files:
file1:
1
2
[code]...
View 8 Replies
View Related
Jun 9, 2010
I highlight a column by selecting "D" > format cells > background > I select a color and press OK. But the color on the document remains the same.
View 3 Replies
View Related
Apr 18, 2010
Is the maximum number of letters a database table column can contain 255?and is it a bad idea to build a table with about 15 columns?
View 1 Replies
View Related
Feb 23, 2010
the color from the table I insert? All I want to do is insert a basic table with 6 columns and 3 rows. I get that, but it has a gradient blue color.
View 1 Replies
View Related
Jul 20, 2010
I have a big file full of records like this
1, 2, 4, 5, 6
1, 3, 5, 6, 3
1, 4, 5, 6, 6
2, 4, 5, 5, 5
2, 3, 4, 5, 2
anyway i need to take the average of all rows with the same 1st number(key). i.e.
1, 3, 4.66, 5.66, 5
2, 3.5, 4.5, 5, 3.5
I know this is something awk/sed would be great for, i just dont have enough experience with them to accomplish it, Also, what about averaging those columns together? so, after I output this to a file, id like to get another like:
1, 4.58
1, 4.125
The number of colums to add might not always be 4 either. EDIT: this might be easier to do in gnuplot, so I mainly just need an answer to the first part.
View 3 Replies
View Related
Jul 22, 2010
I'm not that familiar with sed and awk in order to be able to solve this problem on my own, so I'm calling on you for a bit of assistance. I'm writing a Nagios plugin to check our Oracle tablespaces and the output is given in one line like this: 1.04007771 TEMP 0 UNDOTBS1 .005340579 USERS 0 7 rows selected. I've been playing around with sed like below to delete the obsolete info and change every second space into a newline:
[code]...
how many tablespaces there are so I'd have to check all databases and 'hardcode' the tablespaces in my script. Is there any way to 'automate' this knowing that 'rows selected' preceded by a number is always the last line and using a sort of counter to auto-adjust the number to put in the -e 's/ / /2' part?
View 7 Replies
View Related
Jun 24, 2011
I'm writing a script and I have doubts on how to assign values to an already established variable. The value for the vatriable would be coming from a file with three columns. I'm using the awk command for this. Am I doing it correctly? which of the following two ways is the better one or if both are wrong which one should I use?
#!/bin/nsh
inputfile=$1
rolename=$2
[code]....
View 2 Replies
View Related
Mar 20, 2011
I'M working my way through Trainsignal's CompTIA Linux + Training course and I have a question about IRQs. According to the lesson using the command "cat /proc/interrupts", I need to memorize the system IRQs number columns 0-15. But when I use this command, I get somewhat of an unordered list, see below.
Code: cat /proc/interrupts
CPU0 CPU1
0: 48 7 IO-APIC-edge timer
1: 247 205 IO-APIC-edge i8042
[Code]....
View 1 Replies
View Related
Apr 5, 2011
I m using SUN Server .
How would i determine the number of RAM slots using dmidecode.
I m running following command to get RAM information. code....
View 7 Replies
View Related
Jul 1, 2010
Can someone explain how to determine the number of blocks to determine the number of cylinders for a new partition on hard drive.
Why is block size divided by 1024?
I think I understand unit size is the total bytes per cylinder, I get that. I understand the anatomy of the hard drive (i.e. heads, sectors, cylinders.
My problem is, if I need to calculate the number of cylinders needed for let's say a 20G partition on a 120G drive.
View 1 Replies
View Related
Sep 9, 2010
When running cat /proc/cpuinfo under Linux, a variety information is kicked-back. For example:
> cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
[Code]...
First, what does all of that actually mean? I see I have a processor 0 and processor 1. Does that mean Linux is reporting both cores of the CPU, or, since it is a VM, the two that I happen to have right now (even if they're on physically different CPUs)?
Second, how can I get a similar information dump form the command line in Windows? Third, is there a way using either platform to determine the number of physical CPUs versus total CPU cores?
View 2 Replies
View Related
Oct 31, 2010
Code:
cat ${SOURCE}/{start,universal,index,end}.txt > ${SERVER}/index.html
cat ${SOURCE}/{start,universal,02042010,end}.txt > ${SERVER}/02042010.html
[code]....
View 3 Replies
View Related
Apr 9, 2011
How to get output of text file containing account number, debit amount, credit amount,date using shell script?
View 1 Replies
View Related
Mar 11, 2010
I have a csv file that has around 3 million rows. I want to process this file so that it creates a new file that contains only the rows that have 2 characters or less in the first column column.At the moment i am using SQL Loader but its taking too long so im wondering whether this would be easier if done in Unix?
View 8 Replies
View Related
Mar 29, 2010
I am trying to write a script which compares a log file with reference file. The log file has a table, the LHS of the table are constants strings and RHS of table values changes if there are any changes in configuration.code...
Here I am looking for a script which compares test.log file ( whose RHS data-types are known prior whether it is digit or string) with test.Ref which is reference file for test.log file. It will be really helpful for me if any of you give some idea about writing this script.
View 2 Replies
View Related
Apr 29, 2010
In KDE's Konsole, I can do the following from the terminal:
dcop kwin KWinInterface currentDesktop
And it will tell me which desktop my terminal is connected to ( per [URL])
How can I determine what desktop number the current gnome terminal in a gnome session is connected to?
View 1 Replies
View Related
Oct 12, 2010
what are the two ways you can identify the PID nimber of your login shell
View 14 Replies
View Related
Jul 27, 2011
I've searched everywhere and I can't come up with a good solution. For each line I need to find the average, min, and max. I've seen plenty of solutions where the number of columns is fixed, unfortunately for me these lines can get pretty large. My thought was to read each line individually into an array, loop through the array and find the avg, min, and max that way but i haven't had much luck. I can read each line using a while loop but I'm having trouble with the array part, or perhaps that's not the best solution?
View 14 Replies
View Related
Jun 30, 2011
I'm currently running Ubuntu (w/ GRUB) and Windows XP. I'd like to remove Ubuntu and run the recovery on Windows XP because it has started not running correctly. The computer is about 5 years old and I figured I'd just wipe it clean and start over (read: remove Ubuntu and reinstall windows via the recovery console).
I intend to follow the tutorial here: [URL]
However, I'm confused about determining the boot device number for Windows. I've run "sudo fdisk -l" and I can identify the windows drive in the list it says:
Device: /dev/sda1
Boot: *
Start: 1
End: 19352
Blocks: 155444908+
Id: 7
System: HPFS/NTFS
Am I looking for the 7, the 1, or something completely different? This is also the first partition on the list.
sda2 (id: c) is a FAT32 drive. I think this is the recovery partition included on the HP desktop.
sda3 (id:83) is Linux
sda4 (id: 82) is swap
I just need to run fixmbr.
View 2 Replies
View Related
Jul 27, 2010
I'm looking to get a shell script to loop through a number of directories and subdirectories,looking for files that contain a particular substring, and renaming the file by replacing the search string with a different substring. For example if you had a directory full of folders that contained digital photos (along with various other files which would need to remain unaffected), and the intent was to remove the "DSC_" prefix from several thousand files buried within. I've whipped up a rather long-winded solution that works well for this purpose but chokes on directory names with spaces. I am reasonably sure there's a 2 or 3-liner that would accomplish this exact same task.
function investigate
{
path=$1
for file in `ls $1`
#for file in *
[code]....
View 1 Replies
View Related
Apr 7, 2010
I need to find TCSH shell and gzip version number by running a acript on several boxes through ssh. How can i do that? I made a script for tcsh but it is not working by ssh , it only works on my box . I dont know from where to find the gzip version info.
View 5 Replies
View Related
Feb 18, 2011
i want to write shell script that give a number between 1-3444 from user and if user enter out of range number give error e.g number must between
read -p "plz Enter Number " p
while [ $p != [1-9] -o $p != [1-9][0-9] -o $p != [1-3][0-4][0-4][0-4] ]
do
read -p "plz Enter Valid Number" p
done
but this have an error in while statement ! two many argument
View 3 Replies
View Related