Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-24-2008
Registered User
 

Join Date: Jun 2008
Posts: 7
Question To read and separate number and words in file and store to two new file using shell

hi,
I am a begginer in unix and i want to know how to open a file and read it and separate the numbers & words and storing it in separate files, Using shell scripting.
Please help me out for this.


Regards
S.Kamakshi
Sponsored Links
  #2 (permalink)  
Old 06-24-2008
Moderator
 

Join Date: Feb 2007
Location: The Netherlands
Posts: 4,962
Is this a homework question? If it isn't what is the "real world problem" of your question and what have you done to attempt to solve this problem yourself?
Post your sample script, and we'll see how we can assist.

Regards
  #3 (permalink)  
Old 06-26-2008
Registered User
 

Join Date: Jun 2008
Posts: 7
Red face script for separating numbers and words in a file.

Hello,

Please correct me if i am wrong,

#! /bin/bash

FILE1="$1"
FILE2="$2"
FILE3="$3"

sed 's/[0-9]//g' $FILE1 > $FILE2
sed 's/[a-zA-Z]//g' $FILE1 > $FILE3


This is the script where filenames are fetched from command prompt.


Regards
S.Kamakshi
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Read and store each line of a file to a variable seijihiko UNIX for Dummies Questions & Answers 4 06-17-2007 06:57 AM
Read words from file and create new file using K-shell. bsrajirs Shell Programming and Scripting 4 06-01-2007 01:15 PM
how to read each letter from file and store it in variable. rajan_ka1 UNIX for Advanced & Expert Users 7 03-06-2006 09:03 PM
store output to a file and read from it afadaghi Shell Programming and Scripting 2 10-04-2005 01:00 PM
Listing words from a file on a Separate Line Astudent UNIX for Dummies Questions & Answers 2 03-14-2001 06:44 PM



All times are GMT -4. The time now is 12:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0