UNIX File reading question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers UNIX File reading question
# 1  
Old 10-04-2014
UNIX File reading question

Is there a script that will automatically access/count the words in each individual file for a program?

(Sorry, I'm trying to help my girlfriend who's in computer science out, I know nothing about this. We're having trouble wording this question.)
# 2  
Old 10-04-2014
Your girlfriend needs to do her own homework... And,

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Basic line reading and file merge question

No doubt these questions have been answered many times, but I struggled to find them - sorry. 2 questions: 1. I wish to read in a file one line at a time and do 'stuff' with it, such as: file="tst2" while IFS= read -r line do echo `wget -qO -... (3 Replies)
Discussion started by: Golpette
3 Replies

2. Shell Programming and Scripting

Simple Question about Reading file by Perl

Hi , I just write a simple function to read the file line by line. But when I run it it says out of memory. I am not sure about the root cause, Can someone help me out of this? :D #! /usr/bin/perl use strict; sub checkAPs{ my $NDPDir = "/home/eweiqqu/NCB/NDP_files/"; ... (1 Reply)
Discussion started by: Damon_Qu
1 Replies

3. Shell Programming and Scripting

Reading UNIX commands from file and redirecting output to a file

Hi All I have written the following script: #!/bin/ksh while read cmdline do echo `$cmdline` pid="$cmdline" done<commands.txt =========== commands.txt contains: ps -ef | grep abc | grep xyz |awk '{print $2}; My objective is to store the o/p of the command in a variable and do... (8 Replies)
Discussion started by: rahulparo
8 Replies

4. Shell Programming and Scripting

UNIX file reading

i have a directory that has n files starting with ABC_00x.txt and ABC_00x.txt where x is the integer number. i want to read the contents of each file and write it into a log file. can somebody help me in writing the shell script in unix (3 Replies)
Discussion started by: vkca
3 Replies

5. Shell Programming and Scripting

UNIX File handling -Issue in reading a file

I have been doing automation of daily check activity for a server, i have been using sqls to retrive the data and while loop for reading the data from the file for several activities. BUT i got a show stopper the below one.. where the data is getting store in $temp_file, but not being read by while... (1 Reply)
Discussion started by: KuldeepSinghTCS
1 Replies

6. Shell Programming and Scripting

Question about reading and parsing text file

Hello, I'm just getting started with BASH programming. I would like to write a script to solve a file renaming problem I have. I received a directory containing a collection (>2000) of files whose names are in DOS 8.3 format, and woild like to rename the filenames to a longer and more... (8 Replies)
Discussion started by: polomora
8 Replies

7. UNIX for Dummies Questions & Answers

UNIX script for reading a file and creating another file

Hi, I am a beginner in scripting...I have to do a script where I have to read a file which has list of job names, line by line and for every line execute a dsjob command to find the log details of the job and extract only the start time of the job, if it is greater than jan 01 2008 and create... (1 Reply)
Discussion started by: Vijay81
1 Replies

8. Shell Programming and Scripting

file reading in unix

Hi , I need to read line by line from a file. Can u please tell me the most efficient way to do it. SInce i will be reading more than 1000 files in my program. i am trying the following options : 1. nawk option nawk'{ print $0 }'files.temp 2. filecount=`cat files.temp | wc -l`... (2 Replies)
Discussion started by: pradeepthanraj
2 Replies

9. UNIX for Advanced & Expert Users

Reading lines within a Unix file.

I have a file that has a list of numbers in it. Each line has a different number. I am trying to create some sort of loop within a script that will pick the numbers up on lines 1 and 2 and then put those figures into the script. It then goes through the process then loops back and reads lines 2 and... (5 Replies)
Discussion started by: mariner
5 Replies

10. UNIX for Advanced & Expert Users

Reading Particular Line From A File in Unix

Can any u pls tell me :- I want to read a particular line from a file, say line no. 10. This can be done by using awk..but that method I think, is inefficient. Is there any direct command for this? Thanks (2 Replies)
Discussion started by: yeheyaansari
2 Replies
Login or Register to Ask a Question