Sponsored Content
Top Forums UNIX for Dummies Questions & Answers To Extract words from File based on Position Post 302399426 by kuttu123 on Sunday 28th of February 2010 01:02:46 AM
Old 02-28-2010
Hi,

Thanks for the response.

Still Getting an error at the string display part!!

I will summarise what I am trying to do. Sorry if I had confused anyone.
I am pasting the in_file & out_file for your referece.

Please help.

This is my problem:--->

In_file

I like Orange Very Much
I like Mango also
We are Grape lovers.
We play Cricket usually
We are Chess players

The out_file needs to look like this

I like Apple Very Much
I like Apple also
We are Grape lovers.
We play Football usually
We are Football players


Task for Shell script :---

1 Read in_file --> user input
2 Get out_file name --> user input
3 Display the strings b/w coulmn 9 to 17 in the in_file for all the records.


Changes
--------
4 If Orange/Mango comes in the specified postion need to change as Apple.


5 If Cricket/Chess comes in the specified postion ,need to replace as Football and save in the out_file

6 Display the strings b/w coulmn 9 to 17 in the output file

( Like this i have many changes. I am using a single SED command for the task, It is working fine(but its just a pattern matching one, not checking position, I would like to add that feature also) . But problem is the string display portion is not working )



Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract words to new file

Hi there, Unix Gurus Working with big listings of english sentences for my pupils, of the type: 1. If the boss's son had been , someone would have asked for money by now. 2. Look, I haven't a crime, so why can't you let me go? .... I wondered how to extract the words between brackets in... (7 Replies)
Discussion started by: eldeingles
7 Replies

2. Shell Programming and Scripting

Extract data based on position

The file has record length 200. And i have 100 search strings which are ten digits of character from 1 to 10 characters all of them are unique, they need to searched in a file. Please help me to pull the records based on position (say from 1-10). test data 1FAHP2DW0BG115206RASHEED ... (6 Replies)
Discussion started by: zooby
6 Replies

3. UNIX for Dummies Questions & Answers

Script to delete a word based on position in a file

Hi, I am new to unix. I want to delete 2 words placed at position say for example at 23rd and 45th position in a line. I used sed but couldnt achieve this. Example: the file contains 2 lines 12345 98765 "12345" 876 12345 98765 "64578" 876 I want to delete " placed at position 13 and 19... (4 Replies)
Discussion started by: nbks2u
4 Replies

4. UNIX for Dummies Questions & Answers

extract regions of file based on start and end position

Hi, I have a file1 of many long sequences, each preceded by a unique header line. file2 is 3-columns list: headers name, start position, end position. I'd like to extract the sequence region of file1 specified in file2. Based on a post elsewhere, I found the code: awk... (2 Replies)
Discussion started by: pathunkathunk
2 Replies

5. Shell Programming and Scripting

Put words to fix position in a file

Hi all, There are several lines in my file as a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=44 a=3,b=dene,c=22,d=23422342334,g=vxcvxcv,h=4 a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=678 I take values with this command awk -F '' '{print $1,$2,$3}' a.txt I want to put values to a fix position... (6 Replies)
Discussion started by: bahadiraktan
6 Replies

6. Shell Programming and Scripting

Extract substring specif position and length from file line

Hi gurus, I am trying to figure out how to extract substring from file line (all lines in file), as specified position and specified legth. Example input (file lines) dhaskjdsa dsadhkjsa dhsakjdsad hsadkjh dsahjdksahdsad sahkjd sahdkjsahd sajkdh adhjsak I want to extract substring on... (5 Replies)
Discussion started by: ProsteJa
5 Replies

7. Shell Programming and Scripting

Split file based on distinct value at specific position

OS : Linux 2.6x Shell : Korn In a single file , how can I identify all the Uniqe values at a specific character position and length of each record , and simultaneously SPLIT the records of the file based on each of these values and write them in seperate files . Lets say : a) I want to... (4 Replies)
Discussion started by: kumarjt
4 Replies

8. Shell Programming and Scripting

Search for a string at a particular position and replace with blank based on position

Hi, I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies

9. Shell Programming and Scripting

Search words in any quote position and then change the words

hi, i need to replace all words in any quote position and then need to change the words inside the file thousand of raw. textfile data : "Ninguno","Confirma","JuicioABC" "JuicioCOMP","Recurso","JuicioABC" "JuicioDELL","Nulidad","Nosino" "Solidade","JuicioEUR","Segundo" need... (1 Reply)
Discussion started by: benjietambling
1 Replies

10. Shell Programming and Scripting

Replace particular words in file based on if finds another words in that line

Hi All, I need one help to replace particular words in file based on if finds another words in that file . i.e. my self is peter@king. i am staying at north sydney. we all are peter@king. How to replace peter to sham if it finds @king in any line of that file. Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
eleeye_engine(6)														  eleeye_engine(6)

NAME
eleeye_engine - a chess program engine to communicate with its user interface SYNOPSIS
eleeye_engine is a command-line client for UCCI (based on UCI) protocol. It provides full support of basic UCI command, such as position, go, banmoves or bestmove and much more. DESCRIPTION
The Universal Chess Interface (UCI) is an open communication protocol that enables a chess program engine to communicate with its user interface. It was designed and released by Rudolf Huber and Stefan Meyer-Kahlen, the author of Shredder, in November 2000, and can be seen as a rival to the older XBoard/WinBoard Communication protocol. Like the latter, it is free to use without license fees. Customarily, UCI assigns some tasks to the user interface that have traditionally been handled by the engine itself. Most notably, the opening book is usually expected to be handled by the interface, by simply selecting moves to play until it is out of book, and only then starting up the engine for calculation in the resulting position. (UCI does not specify any on-disk format for the opening book; different UIs -- user interfaces -- usually have their own, proprietary formats.) Also, the user interface may handle endgame tablebases if the engine does not support it itself, although this is often better handled in the engine, as having tablebase information can be useful to consider a possible future position. AUTHOR
Written by www.elephantbase.net RESOURCES
Universal Chess Interface Protocol: <http://wbec-ridderkerk.nl/html/UCIProtocol.html> Universal Chinese Chess Interface Protocol: <http://www.elephantbase.net/protocol/cchess_ucci.htm> COPYING
Free use of this software is granted under the terms of the GNU General Public License (GPL). 16 july 2009 eleeye_engine(6)
All times are GMT -4. The time now is 11:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy