Search Results

Search found 8384 results on 336 pages for 'lines'.

Page 10/336 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How do I use grep to extract a specific field value from lines

    - by Stormshadow
    I have lines in a file which look like the following ....... DisplayName="john" .......... where .... represents variable number of other fields. Using the following grep command, I am able to extract all the lines which have a valid 'DisplayName' field grep DisplayName="[0-9A-Za-z[:space:]]*" e:\test However, I wish to extract just the name (ie "john") from each line instead of the whole line which is returned by grep. I tried pipelining the output to the cut command but it does not accept string delimiters.

    Read the article

  • PHP: Loop through text file and isolate lines which a specific "starting point"

    - by Mestika
    Hi everyone, I’m trying to reduce some editing time within some textfiles where there approximately are 10.000 lines of text, but I only need around 200 or some. The text file relies on a almost specific pattern but it deviates from time to time but my “focus” in order to select the right line to keep is, that the line always starts with: z3455 and then have a variable afterwards, e.g.: z3455 http://url.com/data1/data1.1/data1.3/ (342kb) I have an algorithm to capture the URL and its content but now I need some way to loop through the text file, deleting all lines except does that starts with z3455 and then “push” them together so they are listed underneath each other. I’ve tried different approaches for this in PHP but can’t seem to find a correct function. I can “isolate” a specific line number but when it deviates I can’t use this approach fully. I hope that someone can help me, either by providing the code or knocking me in the right direction to how I’ll solve this problem. Thanks in advance Sincerely - Mestika

    Read the article

  • Why are my lines getting thicker and thicker?

    - by mystify
    I try to draw some lines with different colors. This code tries to draw two rectangles with 1px thin lines. However, the second rectangle is drawn with 2px width lines, while the first one is drawn with 1px width. - (void)addLineFrom:(CGPoint)p1 to:(CGPoint)p2 context:(CGContextRef)context { // set the current point CGContextMoveToPoint(context, p1.x, p1.y); // add a line from the current point to the wanted point CGContextAddLineToPoint(context, p2.x, p2.y); } - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGPoint from, to; // ----- draw outer black frame (left, bottom, right) ----- CGContextBeginPath(context); // set the color CGFloat lineColor[4] = {26.0f * colorFactor, 26.0f * colorFactor, 26.0f * colorFactor, 1.0f}; CGContextSetStrokeColor(context, lineColor); // left from = CGPointZero; to = CGPointMake(0.0f, rect.size.height); [self addLineFrom:from to:to context:context]; // bottom from = to; to = CGPointMake(rect.size.width, rect.size.height); [self addLineFrom:from to:to context:context]; // right from = to; to = CGPointMake(rect.size.width, 0.0f); [self addLineFrom:from to:to context:context]; CGContextStrokePath(context); CGContextClosePath(context); // ----- draw the middle light gray frame (left, bottom, right) ----- CGContextSetLineWidth(context, 1.0f); CGContextBeginPath(context); // set the color CGFloat lineColor2[4] = {94.0f * colorFactor, 94.0f * colorFactor, 95.0f * colorFactor, 1.0f}; CGContextSetStrokeColor(context, lineColor2); // left from = CGPointMake(200.0f, 1.0f); to = CGPointMake(200.0f, rect.size.height - 2.0f); [self addLineFrom:from to:to context:context]; // bottom from = to; to = CGPointMake(rect.size.width - 2.0f, rect.size.height - 2.0f); [self addLineFrom:from to:to context:context]; // right from = to; to = CGPointMake(rect.size.width - 2.0f, 1.0f); [self addLineFrom:from to:to context:context]; // top from = to; to = CGPointMake(1.0f, 1.0f); [self addLineFrom:from to:to context:context]; CGContextStrokePath(context); }

    Read the article

  • Objective-C: how to splt a string constant across multiple lines

    - by Ilya
    Hi, I have a pretty long sqlite query: const char *sql_query = "SELECT statuses.word_id FROM lang1_words, statuses WHERE statuses.word_id = lang1_words.word_id ORDER BY lang1_words.word ASC"; How can I break it in a number of lines to make it easier to read? If I do the following: const char *sql_query = "SELECT word_id FROM table1, table2 WHERE table2.word_id = table1.word_id ORDER BY table1.word ASC"; I am getting a error. Is there a way to write queries in multiple lines? Thank you.

    Read the article

  • Make a loop that draws lines in processing

    - by theolc
    I have this piece of code, and i am wondering how to make a loop that will draw these lines... Every 50 pixels on the x-axis... I am curious as to how this can be done and would like to use a loop rather than manually drawing each line! The following is the code for the lines... Please any help would be much appreciated! //set sidewalk fill(255,255,255); rect(0,490,500,10); line(50,490,50,500); line(100,490,100,500); line(150,490,150,500); line(200,490,200,500); line(250,490,250,500); line(300,490,300,500); line(350,490,350,500); line(400,490,400,500); line(450,490,450,500);

    Read the article

  • wrap all lines that are longer than line length

    - by user1919840
    I am writing a program that limits each line to a certain length. this is what i got so far, i am almost done but i still need to cut each line, but i cant figure it out. def main(): filename = input("Please enter the name of the file to be used: ") openFile = open(filename, 'r+') file = openFile.read() lLength = int(input("enter a number between 10 & 20: ")) while (lLength < 10) or (lLength > 20) : print("Invalid input, please try again...") lLength = int(input("enter a number between 10 & 20: ")) wr = textwrap.TextWrapper() wraped = wr.wrap(file) print("Here is your output formated to a max of", lLength, "characters per line: ") wr.width = lLength wr.expand_tabs = True for lines in wraped: print(lines) an example of what the output SHOULD be is this. If the file specified contains this text: hgytuinghdt #here the length is 11 ughtnjuiknshfyth #here the length is 16 nmjhkaiolgytuhngjuin #here the length is 20 and the lLength is specified to 15 then this should print out: hgytuinghdt ughtnjuiknshfyt h nmjhkaiolgytuhng juin Thanks.

    Read the article

  • Any software transforming broken lines into curves?

    - by user32931
    Hello, do you know of any software that would help me transform a broken line into a curved line? For example, I have an octagon or a heptagon and I want it to be transformed into something resembling a circle. if you know such software, please, let me know. Thank You! Update A: Here is an image from the tutorial given to me by Jamie Keeling (right now it's the first answer below). At least the picture there represents what I want. In that tutorial this process is called "flattening paths". I will try to put that image right here, but if it doesn't get displayed, you can find it by this URL: http://msdn.microsoft.com/en-us/library/ms536364%28v=VS.85%29.aspx The red line in the picture is what I would want to submit, and the blue line is what I would want to get in the end:

    Read the article

  • How to prevent truncated output lines in Console2?

    - by evan
    I just started using Console2 and can't seem to find a way to scroll horizontally when command output is wider than the current size of the window and when I try to resize the window the truncated information is just lost. Is there a way to add horizontal scrolling or to fix the resizing issue? If not, are there programs similar to Console2 that do not have this problem? Thanks! EDIT: Actually, my bad, no information is getting lost, it's just not resizing it properly. EDIT: Turns out that if you resize Console2 to make it smaller and cutoff text you can't resize it and get it back?? Is that a bug?

    Read the article

  • Bash: Read lines in a file scenario with sed or awk

    - by user105566
    I have this scenarios: File Content: 10.1.1.1 10.1.1.2 10.1.1.3 10.1.1.4 I want sed or awk so that when i cat the file every time new line is returned. like First iteration: cat ip | some magic 10.1.1.1 Second iteration returns 10.1.1.2 Third iteration returns 10.1.1.3 Fourth iteration returns 10.1.1.4 and after n number of iterations, it returns to line 1 Fifth iteration returns: 10.1.1.1 Can we do it using sed or awk.

    Read the article

  • Adding lines to /etc/profile with puppet?

    - by miku
    I use puppet to install a current JDK and tomcat. package { [ "openjdk-6-jdk", "openjdk-6-doc", "openjdk-6-jre", "tomcat6", "tomcat6-admin", "tomcat6-common", "tomcat6-docs", "tomcat6-user" ]: ensure => present, } Now I'd like to add JAVA_HOME="/usr/lib/java" export JAVA_HOME to /etc/profile, just to get this out of the way. I haven't found a straightforward answer in the docs, yet. Is there a recommended way to do this? In general, how do I tell puppet to place this file there or modify that file? I'm using puppet for a single node (in standalone mode) just to try it out and to keep a log of the server setup.

    Read the article

  • crontab not executing all lines

    - by kiasecto
    I have a sudo crontab like this to sync time: # m h dom mow dow command 0 6 * * * ntpdate 10.3.3.3 >> /var/mylog/ntp.log 0 7 * * * /var/mylog/backup.sh >> /var/mylog/backup.log The problem I am having is that the first line (ntpdate) never seems to execute. If I run it manually with sudo that line works. cron does run the backup.sh at the 7, but it never executes then ntp sync at 6. The syslog doesn't seem to show anything. System is Ubuntu 10.04 LTS.

    Read the article

  • Libre Office/Writer PDF export: white borders appear between lines even after setting borders to none

    - by Yttric
    My document prints ok (exactly as it appears on the screen in Libre Office), but when I export to PDF and view the PDF on screen there are white borders around each text or picture object. Here's a sample snapshot from PDF/Preview: http://imgur.com/TWip5 I've tried selecting a paragraph and changing the border property to None as described in Libre Office help (http://help.libreoffice.org/Common/Borders), setting the "Line arrangement Default" to "Set no borders". But borders set by the Format dialog don't correspond to the borders I see in PDF/Preview. In PDF/Preview the border appears on line boundaries. Borders set in Format appear around each picture, for example. What am I doing wrong?

    Read the article

  • How to remove blank lines in .txt file

    - by Brant
    I want to change text file format as following , but don't know how to do (2) 5. The function of the condenser is to: a) vapourise the liquid refrigerant b) change high pressure refrigerant vapour to liquid c) pressurise low pressure refrigerant vapour d) vent off vapourised refrigerant e) lower the liquid refrigerant pressure (2) 6. One tonne of refrigeration is: a) 13958 kJ per day b) 100 kJ per minute c) 233 kJ per minute d) 13958 J per hour e) 335 J per second (2) 5. The function of the condenser is to: a) vapourise the liquid refrigerant b) change high pressure refrigerant vapour to liquid c) pressurise low pressure refrigerant vapour d) vent off vapourised refrigerant e) lower the liquid refrigerant pressure (2) 6. One tonne of refrigeration is: a) 13958 kJ per day b) 100 kJ per minute c) 233 kJ per minute d) 13958 J per hour e) 335 J per second

    Read the article

  • need to run command against multiple lines in file that start with ica-tcp

    - by Nick Parsells
    I want to run a command on each line of a file I have, however its a bit more complicated then I originally thought. The file contents look like this typically; however there are sometimes more connections: SESSIONNAME USERNAME ID STATE TYPE DEVICE services 0 Disc console 1 Conn t-rpal 48 Disc ica-tcp#0 bpofiretest 50 Active wdica rdp-tcp#2 a-nparsells 51 Active rdpwd ica-tcp 65536 Listen rdp-tcp 65537 Listen The command I want to run is reset session ica-tcp#0. I also want to run the same command on any additional connections that start with ica-tcp that the scripts finds in the file. How can I write a script like that in powershell? thanks!

    Read the article

  • Is there a command-line utility app which can find a specific block of lines in a text file, and replace it?

    - by fred.bear
    UPDATE (see end of question) The text "search and replace" utility programs I've seen, seem to only search on a line-by-line basis... Is there a command-line tool which can locate one block of lines (in a text file), and replace it with another block of lines.? For example: Does the test file file contain this exact group of lines: 'Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. 'Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!' I want this, so that I can replace multiple lines of text in a file and know I'm not overwriting the wrong lines. I would never replace "The Jabberwocky" (Lewis Carroll), but it makes a novel example :) UPDATE: ..(sub-update) My following comment about reasons when not use sed are only in the context of; don't push any tool too far beyond its design intent (I use sed quite often, and consider it to be invaluable.) I just now found an interesting web page about sed and when not to use it. So, because of all the sed answers, I"ll post the link.. it is part of the sed FAQ on sourceforge Also, I'm pretty sure there is some way diff can do the job of locating the block of text (once it's located, the replacement is quite straight foward; using head and tail) ... 'diff' dumps all the necessary data, but I haven't yet worked out how to filter it , ... (I'm still working on it)

    Read the article

  • Indenting an x number of lines in vim

    - by Mack Stump
    I've been coding in Java for a job recently and I've noticed that I'll write some code and then determine that I need to wrap the code in a try/catch block. I've just been moving to the beginning of a line and adding a tab. 0 i <tab> <esc> k (repeat process until at beginning or end of block) Now this was fine the first three or four times I had to indent but now it's just become tedious and I'm a lazy person. Could someone suggest an easier way I could deal with this problem?

    Read the article

  • Running multipul lines through a server.

    - by Kevin Roberson
    I am looking to buy numbers in bulk on DIDx.net. After I purchase the numbers in a particular area code, I want to forward those numbers to other numbers that are outside of that area code. This way it will be seen as a local call versus long distance. I have the customers but I don't have the system I need. I have read about Asterisk, VOIP, SIP, and BYOH. But I have no clue what will be the best system for me. Does anyone have any idea what my next step should be when it comes to hardware and software? Or what type of operating system I should use? I basically want to set up a system like GoogleVoice & Phonebooth.

    Read the article

  • NAT Policy Inbound Source Problem on SonicWall TZ-210 with Multiple DSL Lines

    - by HK1
    We recently added three more DSL connections to our SonicWall TZ-210. My NAT Policies work fine as long as I leave them set with an inbound interface of X1, which hosts our original DSL connection. However, I'd like to change some of the NAT Policies to use inbound source/interface X2, X3, X4 or Any. In my initial tests, when I change one of the policies to use an inbound interface of X2, that port forward policy does not work at all. Traffic never makes it to the internal destination. What could be the problem?

    Read the article

  • how to substitude in multiple lines between {{{ and }}} with sed or awk

    - by chris
    First give out the text example: .... text ,.. {{{python string1 = 'abcde' string2 = '12345' print(string1[[1:3]]) print(string2[[:-1]]) }}} .... text ,.. the [[ and ]] happened outside of {{{ too. And maybe there is spaces and tabs before {{{ and }}}. I want to substitude all [[ and ]] into [ and ] between {{{ and }}}. NOTICE: I need to write the result back to original file. ( Maybe sed or awk is not the only way to do this ? )

    Read the article

  • Xterm is not completely erasing field lines

    - by user26367
    We have a SSH tunnel to a remote unix box from Windows clients using Cygwin. It launches a terminal program from the unix box locally on the Windows box for data input. The xterm window is launched as follows xterm -fn 10x20 -bg DodgerBlue4 -fg white -cr white -ls -geometry 90x30 -e program When a screen goes from read only mode to edit mode, the edit fields have ____. When going back to read only mode, a single pixel artifact is left behind for each field. *readonly* User: *edit* User: ___________ *after edit exit* User: . <- this dot is left behind Any idea what we need to change to fix this?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >