Sponsored Content
Full Discussion: Problems while read a file
Top Forums Shell Programming and Scripting Problems while read a file Post 302208274 by lestat_ecuador on Monday 23rd of June 2008 01:06:18 PM
Old 06-23-2008
Error Problems while read a file

Hello guys, i need your help, let me try to explain what i need:

I have a file (plain text) for example with 500 lines, i need to read only from the line 200 until the end of file, and serch the word 'ERROR' onli between lines 200 and 500, that have sence?

Thanx for your help.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

File system problems

Hi All, I am currently running Linux on a file server. The server starts experiencing problems (slow access, no access). After a shutdown and reboot, the file system is corrupted and requires to run fsck to clean up. Is this signs of a failing hard drive? Ken (2 Replies)
Discussion started by: kmcvey
2 Replies

2. Shell Programming and Scripting

Need help with awk - how to read a content of a file from every file from file list

Hi Experts. I need to list the file and the filename comes from the file ListOfFile.txt. Basicly I have a filename "ListOfFile.txt" and it contain Example of ListOfFile.txt /home/Dave/Program/Tran1.P /home/Dave/Program/Tran2.P /home/Dave/Program/Tran3.P /home/Dave/Program/Tran4.P... (7 Replies)
Discussion started by: tanit
7 Replies

3. Programming

Cannot read a file with read(fd, buffer, buffersize) function

# include <stdio.h> # include <fcntl.h> # include <stdlib.h> # include <sys/stat.h> int main(int argc, char *argv) { int fRead, fPadded, padVal; int btRead; int BUFFSIZE = 512; char buff; if (argc != 4) { printf ("Please provide all of the... (3 Replies)
Discussion started by: naranja18she
3 Replies

4. Shell Programming and Scripting

Read a file and search a value in another file create third file using AWK

Hi, I have two files with the format shown below. I need to read first field(value before comma) from file 1 and search for a record in file 2 that has the same value in the field "KEY=" and write the complete record of file 2 with corresponding field 2 of the first file in to result file. ... (11 Replies)
Discussion started by: King Kalyan
11 Replies

5. Shell Programming and Scripting

Problems restraining read command to 32 bits -perl

Hey everybody, I'm having difficulty using the read command to perform a checksum operation. Whenever I print the final checksum, the result always returns FFFFFFFF, and I know thats not the checksum. #!/usr/bin/perl -w use strict; use FileHandle; use warnings; my $data... (0 Replies)
Discussion started by: TeamUSA
0 Replies

6. Shell Programming and Scripting

bash: read file line by line (lines have '\0') - not full line has read???

I am using the while-loop to read a file. The file has lines with null-terminated strings (words, actually.) What I have by that reading - just a first word up to '\0'! I need to have whole string up to 'new line' - (LF, 10#10, 16#A) What I am doing wrong? #make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies

7. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

8. Ubuntu

Problems with a .sh file in cron

Hi guys. This is my first post so bear with me. I'm trying to get cron to run a shell script in my home directory (/home/server) that checks the temperature of my HDD. The script works fine, however I can't run it in cron. I've checked the syslog and I have only seen two errors: - Exited with... (11 Replies)
Discussion started by: Rautoner
11 Replies

9. Programming

File upload problems

When I upload image files they have the same extension twice. And my script doesn't show it even it the path is correct. Some scripts copy the file from the tmp dir server to the required directory, while others just move it. What happens to the files that were just copied? Do they stay... (1 Reply)
Discussion started by: AimyThomas
1 Replies

10. Shell Programming and Scripting

Read from file and execute the read command

Hi, I am facing issues with the below: I have a lookup file say lookup.lkp.This lookup.lkp file contains strings delimited by comma(,). Now i want to read this command from file and execute it. So my code below is : Contents in the lookup.lkp file is : c_e,m,a,`cd $BOX | ls cef_*|tail... (7 Replies)
Discussion started by: vital_parsley
7 Replies
lrs(1grass)							Grass User's Manual						       lrs(1grass)

NAME
lrs - LRS (Linear Referencing System) LRS (Linear Referencing System) LRS (Linear Referencing System) A Linear Referencing System (LRS) is a system where features (points or segments) are localized by a measure along a linear element. The LRS can be used to reference events for any network of linear features, for example roads, railways, rivers, pipelines, electric and tele- phone lines, water and sewer networks. An event is defined in LRS by a route ID and a measure. A route is a path on the network, usually composed from more features in the input map. Events can be either points or lines (segments). LRS is created from input lines and points in vector map. Points - MP (mileposts) must have attached attributes specifying line and dis- tance. The distances from the beginning of the linear feature in real world are specified by MP+offset. Typically, MP is in kilometers and offset in meters. The implementation of LRS in GRASS has some particularities. Double referenced system This feature gives a possibility to continue to use most of old mileposts if only small part of linear object in real world has changed. Example: --- road (linear feature) + MP (milepost, point, distance from the beginning in km) Old situation: +----+----+----+----+----+ 0 2 3 4 5 6 New situation (for example a new bypass around the village) ? ? +----+ | | | | +----+----+ +----+----+ 0 2 3 4 5 6 The segment between km 3 and 4 is now longer, it is now 3 km not 1 km as in old version. It would be expensive to change also all MP >= 4, but we cannot use km 4 twice. It is possible to use another notation for the new segment, we reference the segment from the kilometer 3, using only offset. 3+1000 3+2000 +----+ | | | | +----+----+ +----+----+ 0 2 3 3+3000 5 6 4 This way, there is no ambiguity and minimal changes are needed. But the MP 4 is no more the end of segment 3 - 4 but the end of segment 3+2000 - 3+3000. This information must be entered to the system and it is done by optional MP attributes: end_mp - end MP end_off - end offset In this case original MP on km 4 will have these attributes: start_mp: 4 start_off: 0 end_mp: 3 end_off: 3000 Because each MP can keep 2 values (start, end) it is called 'double' referenced LRS. To avoid potential confusion, MP values are limited to integers only. It would be ambiguous to have for example segments 3.500 - 3.500+200 and 3.600 - 3.600+200. The position 3+650 would fall into 2 segments, correct would be 3.600+50. That means, that MP must be the beginning of antonomous segment and all parts which becomes longer then before must be referenced from the last not changed MP. The MP start_mp and end_mp columns must be decimal, but v.lrs.create takes only the decimal part, and adds its value to offset and prints a warning. It is highly recommended to work with polylines instead of segmented vector lines. The command v.build.polylines creates this map struc- ture. LRS table structure | Attribute | Type | Description | rsid | integer | reference segment ID, unique in the table | lcat | integer | category of the line in the LRS map | lid | integer | route ID (LID) | start_map | double precision | distance measured along the line in LRS map from the beginning of the line to the beginning of the segment (absolute milepost distance) | end_map | double precision | distance measured along the line in LRS map from the beginning of the line to the end of the segment (absolute distance of subsequent milepost) | start_mp | double precision | milepost number assigned to the start of the segment | start_off | double precision | distance from start_mp to the start of the segment measured along the physical object | end_mp | double precision | milepost number assigned to the end of the segment | end_off | double precision | distance from end_mp to end of the segment measured along the physical object | end_type | integer | 1: the same as specified for from_ ; 2: calculated from map along the line from previous MP; 3: defined by user Available commands v.lrs.create to create a linear referencing system, v.lrs.label to create stationing on the LRS, v.lrs.segment to create points/segments on LRS, and v.lrs.where to find line id and real km+offset for given points in vector map using linear referencing system. Input lines for v.lrs.segment and v.lrs.label v.lrs.create joins all connected lines of the same line ID into one line, the LRS library and other modules using LRS expect this! LR_get_nearest_offset in the LRS library checks duplicate segments only by line_cat and map_offset, not by coordinates in map. Duplicate positions It can happen that one offset appears on 2 different lines: ------1------- --------2------ +0.0 +1.0 +2.0 In this case, the module gives error because the position results in 2 points. It can be also intended, for example a part of the road is shared with another one, but MP are used only for one: + road1/km15 + road1/km22 / road1/km17 / road1/km20 +--------------+ / road2/km52 road2/km52 / + road2/km50 + road2/km54 NOTES
Explanations of selected options: llayer: vector layer in line map (usually 1; see vectorintro for "layer" concept) player: vector layer in point map (usually 1; see vectorintro for "layer" concept) rsdriver: Driver name for LRS table - DBMI SQL driver (dbf, pg, mysql, sqlite, etc) rsdatabase: Database name for LRS table - DBMI SQL database name (e.g., "lrsdb") rstable: Name of the LRS table - DBMI SQL table name (e.g., "streamslrs") SEE ALSO
R. Blazek, 2004, Introducing the Linear Reference System in GRASS, Bangkok, GRASS User Conf. Proc. R. Blazek, 2005, Introducing the Linear Reference System in GRASS, International Journal of Geoinformatics, Vol. 1(3), pp. 95-100 v.build.polylines, v.lrs.create, v.lrs.segment, v.lrs.where, v.lrs.label AUTHOR
Radim Blazek, ITC-irst/MPA Solutions Trento Documentation update (based on above journal article and available fragments): Markus Neteler Last changed: $Date: 2011-11-08 10:42:51 +0100 (Tue, 08 Nov 2011) $ GRASS 6.4.2 lrs(1grass)
All times are GMT -4. The time now is 11:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy