Please Help!!   (Stripping first 7 Characters of every line in a file???

Hey guys,
I need to read in a file but strip the first 7 characters from each line in the file???
How do i do it...
Any help will be appreciated...

Dear Friend,
Thankyou very much for your interest.
I am trying to strip the 1st 7 characters from the following file while reading....
1. <?xml version="1.0" encoding="UTF-8"?>
2.
3. <DOCUMENT>
4. <GREETING>
5. THE LIVE EXAMPLE...
6. <MESSAGE>
7. </GREETING
8. If this works then your project is over...;;;
9. </MESSAGE>
10. </DOCUMENT>
I meant, if my file contains line break (space of a line between two lines just like in Double Line spacing. Eg. between 1 and 3).... the program doesn't read after reading the first line. Your method does stip first seven characters of first line...
Your help is appreciated....

Similar Messages

  • Printing the First 14 Characters of Every Line in a Text File

    My text file looks like the following:
    1111097116274, H0101C58F8110C005, 1, 16:48:03
    1111097116274, H0100058F8110C006, 2, 16:48:10
    1111097116274, H00F0458F8110C006, 3, 16:48:12I want my java program to print the first 14 characters of every line. Here's what I have:
    import java.awt.*;
    import javax.swing.JOptionPane;
    import java.io.*;
    public class Read {
         public static void main( String args[] ) {
        try {
            BufferedReader in = new BufferedReader(new FileReader("aFile.txt"));
            String line;;
            /*String tagid;*/
            while ((line = in.readLine()) != null) {
                 char[] tagid = line.toCharArray();
                 line.getChars(0, 14, tagid, 0); 
                 System.out.println(tagid);
            in.close();
        } catch (IOException e) {
             JOptionPane.showMessageDialog( null, "Error" );
             System.exit(0);
         Instead of printing the first 14 characters of every line to output, it prints the whole text file.
    Any ideas of what's wrong?
    Thanks.

    Well, that's the thing with a highly tuned, precision engine like your mind, JosAH. Adding a little alchohol to the fuel mix provides a performance boost, but as the alcohol/fuel ration increases, the performance improvement peaks and then degrades, until the performance is actually reduced. Now, I understand that in the case of the magic Grolsch, this performance curve is shifted farther to the right (graphed with Grolsch count as the independent variable, and performance improvement as the dependent variable), but it still occurs.
    I recommend nitrous oxide. You may need to get your piston heads hardened, though.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can we read some bytes from every line of the file

    How can we read some bytes from the every line of the file moving on to the next line
    without using the read line

    Actualiy readLine() takes more execution time
    for reading a part of line if we can do so without
    readLine() we can save some time...Well, if you knew, beforehand, the length of each line, you could use RandomAccessFile and its seek method, but, since you don't, you would have to read the rest of the line character-by-character, checking to see if it is a newline, in order to place the "cursor" at the beginning of the next line in order to read the next few characters you want.
    So, as you can see, you will need to read the entire line anyway (and if you do it yourself you also have to do the checking yourself considering all three possible end-of-line sequences), so you just as well use readLine().
    Some people may suggest Scanner and it's nextLine() method, but that also needs to read the rest of line (as evidenced by the fact that it returns it), so that is no different than the readLine() (or read it yourself) solution.

  • Please help! first website! movie clip placed on main timeline wont play!

    Hi! if any one could please help me it would be greatly
    appreciated!
    So im trying to make my first website in flash and ive ran
    into a problem. I have the main movie, my main time line. I have a
    few animations going on in this that were all created in that main
    time line. those work fine. however, i created two new movie clips
    (still inside the same .fla file) and animated them with thier own
    time line. I then thought you could just drag and drop these movie
    clips onto your main time line and they would play inside the
    movie. but when i press ctrl + enter, the dont play!
    here are some points of intrest.
    my main movie (the main time line) is 130 frames.
    the movie clips i made inside the same .fla file are between
    400 and 600 frames.
    i placed both new movie clips on the 130th frame in the time
    line with their own layers.
    also there is a layer for actions on the 130th that has
    stop();
    i thought that maybe the time line had to be as long as those
    movie clips i created and so i extended it but they still didnt
    play.
    im thinking action script is involved? please help me im
    getting pretty frustrated and im sure there is something simple to
    achieve this.
    here is a link where you can download the source files im
    using. if you open the file the two movie clips i created are
    called front two and front one and are layers with the same name.
    this board wont let me fully post my link cause the last word
    in it is s*h*i*t* so youll have to type it in your browser. its
    http://public.me.com/matts*h*i*t*
    (just remove the asterisks)
    also i noticed that my file is huge. i used photoshop to
    create everything and them imported it into flash. is there a way i
    can reduce this size?
    thank you sooo much! please help!
    -Matt

    Hey Matt,
    I'll take a look at your file, but as a general rule, a
    movieclip's timeline plays automatically when it is first
    instantiated. Instatiated means its first frame where "it exists"
    on the timeline that contains it. So the layer that holds your
    movieclip animation, needs to extend the length of the timeline you
    want that movieclip to "exist". Other than that rule, the frames
    don't NEED to match the frames inside said movieclip.
    So, if movieclips play automatically, and yours isn't, there
    must be something either stopping the movieclips timeline, or your
    movieclip isn't existing on the timeline because the layer that
    holds it, doesn't have keyframes the length you need it to.
    Yeah optimizing your sprites (2d graphical elements), and
    using vector when you need to (if you don't know the difference
    between raster and vector, google it) will significantly lower your
    outputted .swf file size.
    Edit: After looking at your file, your movieclips are not
    playing (well, they're technically playing, just not showing up)
    because your masker layer has multiple objects on it. A masker
    layer (not to be confused with the maskee layer, the layer being
    masked) needs to have only one object on it, or else you break the
    mask. The grey border of your mask movieclip needs to be deleted
    before your animation will play.

  • Can someone please help me color in characters?

    I have this picture so far. I need help filling in the characters with color.

    You can also use the Blob Brush Tool to fill in color. It's mentioned towards the end of the video link:
    http://tv.adobe.com/watch/csinsider-design/illustrator-a-closer-look-at-the-variable-width -tool-for-illustration/
    Just make sure to either "Send to Back" the color shape or draw it in a layer underneath your line drawings. So that you can keep your drawing in front.

  • Please help... my computer that has all of my files for itunes on it is not working properly. I have a new computer and I want to put all the music that is currently on my ipod onto my new computer but everytime I connect it says my only options are to de

    I need to know how I can connect my ipod and have it upload the music on it to my new computer. I have 900+ songs on it right now and alot are from CD's that I no longer have access to. I have had this ipod for forever and I want all the music to show up on my new computer but everytime I connect it says my only options are to sync and erase everything or only transfer the music that was bought on the itunes store which isn't alot since like I said most is from CD's that I don't have anymore. Is there any way to make this happen? Please help!!!

    See this older post from another forum member Zevoneer covering the different methods and software available to assist you with the task of copying content from your iPod back to your PC and into iTunes.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

  • How to get characters from a line in a file ?

    Hello Everybody ,
    I am able to read the lines from the file using readLine( ) method.
    But i do not want to read anything that comes after the character '#'
    Any thing that follows a '#' character is considered as a commet in my case.
    The contents of my input file are,
    #Character mappings for Japanese Shift-JIS character set
    #ASCII character Mapped Shift-JIS character
    m 227,128,133 #Half width katakana letter small m
    n 227,128,134 #Half width katakana letter small n
    o 227,129,129
    p 227,129,130
    q 227,129,131
    r 227,129,132
    s 227,129,133
    t 227,129,134
    u 227,129,135
    v 227,129,136
    w 227,129,137
    x 227,129,138
    y 227,129,139
    z 227,129,142
    My code to read the contents of the file is,
    import java.io.*;
    class Read
    public static void main(String s[])
    try{
    int i=0,j,l;
    BufferedReader in=new BufferedReader(
    new InputStreamReader(
    new FileInputStream("Character.txt")));
    String []str=new String[100];
    while(true)
    str=in.readLine();
    if(str[i]==null) break;
    System.out.println(str[i]);
    i++;
    catch(Exception e)
    e.printStackTrace();
    System.out.println(e);
    How do i store the values within a line in the file
    to two different variables
    Like say,
    I read the line
    i get the character 'm' store it in a variable say, char ch='m' ;
    and the corresponding value 227,128,133 in a String variable.
    String str="227,128,133";
    Please offer some suggesstions and help me out .
    Any suggesstions would be welcome and very useful.
    Thanks and regards
    khurram

    It depends on whether the format of the file will ever change. If the "rules" regarding the structure of the file are predictable, then it's fairly simple.
    In the sample file, if we assume that anything that starts with # should be ignored, and all relevant lines begin with single char, followed by three comma separated integers; then you can just do the following (haven't tested this)
    import java.io.*;
    class Read
         public static void main(String s[])
              try{
                   // Create a Map to store the results..
                   Map data = new HashMap();
                   // We will store the actual values in an array
                   int[] values = null;
                   // Each valid line has a character
                   char theChar;
                   // Temp storage for the integer values
                   String[] strValues = null;
                   BufferedReader in=new BufferedReader(
                   new InputStreamReader(
                   new FileInputStream("Character.txt")));
                   String str=null;
                      while(true)
                        str=in.readLine();
                        if(str==null) break;
                        // trim to remove any spaces
                        str = str.trim();
                        theChar = str.charAt(0);
                        if(theChar != '#') {
                             // not a comment
                             // Split to get the int
                             strValues = str.substring(1, str.length()).split(",");
                             // We only want the first 3 tokens
                             values = new int[3];
                             for(int i = 0; i < values.length; i++) {
                                  values[i] = Integer.parseInt(strValues);
                             // Now, add the results to the map
                             data.put(String.valueOf(theChar, values);
                             System.out.println(str);
              catch(Exception e)
                   e.printStackTrace();
                   System.out.println(e);
    This will leave you with a Map of the character mappings, keyed on the String value of the character (just because you can't store a char in a Map)

  • Please Help: Ignore first Character in a String.

    How do you ignore the first Character in a String?
    String a = JTable.getValueAt(row,column).toString();
    //Ignore first Char of a? ('$')
    double b = Double.valueOf(a).doubleValue();Any help would be appreciated!

    Ok,so I do that. Now I have the Char '$'. But I don't want '$', I want everything after it. Must I loop throught the rest of the string or can I just remove the first Char?

  • PLEASE HELP iPhone 4s wont restore despite every fix error 29/21

    Hi all,
    I thought I was being clever telling a mate at work Id be able to fix his 4s after he tried to upgrade to ios7 and it basically bricked. when on it shows the cable and world symbol and nothing else.
    what ive done so far:
    entered dfu and tried to restore numerous different firmwares including the latest but no luck. I will say that restoring on itunes to latest firmware gets 99% there before failing error 29 (sometimes 21).
    edited hosts file in terminal to remove the gs.apple file. does nothing
    downloaded tiny umbrella to remove cydia thingy but its not highlighted anyway
    exited itunes before doing any host file edits and rebooted.
    if i don't edit hosts file i dont get an error code i get 'requested build cannot be done' message
    phone is currently useless but i cant understand why i cant boot an earlier firmware to get it out of this loop of failure??
    any help in non tech terms would be gratefully received other than 'chuck it away and buy another' - this MUST BE FIXABLE
    Kris

    No jailbreak. all of the online 'fixes' related to installing tiny umbrella to exit the restore mode and unchecking a Cydia (whatever that is) is one of the main points. I was just suggesting it doesn't work.
    I Assume u work for apple based on the fact you would care about a jailbroken phone (I can't imagine it bothers anyone else) so perhaps you could look into this fault? I have read about a battery fault issue but I can't see how one day on iOS 6 it works and then on attempting to install 7 it's now a battery fault? Makes no sense. Thanks

  • Please help with first time PC build

    As a guy coming from a 8 year old 3,1 MacPro into PCs I need a bit of help evaluating all the different combinations when it comes to building a PC.
    I'm woking in CC mainly with After Effects and Premiere. In AE I'm working with Element 3D/optical flares, getting into some C4D.
    Premiere mainly with HD and Blackmagic cinema dng & prores. Working with some 4k Red footage. Additional CC applications but After Effects and Premiere are the main concern. Also, hoping to use Resolve, but haven't.
    I'm not going to be building it myself, there is a computer place that will be assembling and this was their suggested build with parts that they usually use with workstations along with some of my input from looking online. I think the vast amount of work they do is for gamers, and since I won't be gaming at all I want to make sure this is a solid work machine.
    Motherboard : 2011-v3 : ATX : X99S SLI PLUS : MSI
    CPU : Intel Core i7 5820K (6 x 4.0 GHz Overclock, 12 x threads)
    Case : ATX : No PSU : P70 Silence (Black) : Antec
    PSU : 750W : Smart Standard 80 Plus : SP-750PCBUS : Thermaltake
    RAM : Desktop DDR4 : 16GB/Kit : PC4-17000 : Crucial
    Cooling : CPU : Liquid : 120mm : Kuhler H2O 650 : KuhlerH2O650 : Antec
    Video Card : PCI-E : NVIDIA : GTX 970 : 4GB : ZT-90101-10P : Zotac
    HD : SSD : 250GB : SATA3 : Samsung 850 EVO (OS, Programs)
    HD : HDD : 2TB : SATA : WD2003FZEX Black : Western Digital (media, projects)
    HD : SSD : 500GB : SATA3 : BX100 Series : CT500BX100SSD1 : Crucial (media cache, previews, exports)
    I have a couple of 500GB 7200 seagate drives that were in my mac pro that I will probably bring over to keep photos, documents and other personal stuff.
    I have a 3TB caldigit vr raid that I'm thinking I can connect to the pc via esata
    As a potential extra I'm considering a 4TB backup drive where I can copy everything over incase of a drive failure.
    I appreciate any input, thanks

    Thanks,
    I've been reconsidering my build in light of what you said and I'm hoping you could look it over.
    PSU - EVGA SuperNOVA 850 - $174.99
    CASE - Fractal Design Define R5 - $139.99
    I'm still not sure about cooling. The R5 has 2 fans included, on on the back and one of the front. Is that enough or do I need another?
    CPU cooler - From what I understand I will still need a fan on the CPU and I've seen the Noctua NH-D15 and Cooler Master Hyper 212 EVO on other forums. Thoughts?
    I have no experience over clocking so I'm thinking I will just leave the CPU as is.  Correct me if I'm wrong but I've heard the 5820 is a better price/performance value than the 5930 so I'm thinking it's worth it to save the $250. Unless this CPU only makes sense if you OC
    CPU - i7-5820K Haswell-E 6-Core 3.3GHz- $469.99
    Motherboard - Asus 99-A - $334.99
    Originally I had the regular Crucial Ram picked out but It looks like the Crucial Ballistix Sport has a higher speed and is on sale for basically the same price. Latency is 15 for the regular and 16 for the ballistix? Is that the right call?
    RAM - Crucial 32GB (4x8GB) DDR4 2133 PC4-17000 - $449.99
    OR
    RAM - Crucial Ballistix Sport 32GB (4x8GB) DDR4 2400 PC4-19200  - $439.99
    Video Card - GIGABYTE GV-N970G1 Gaming-4GD GTX 970 - $449.99
    System Drive - Samsung 850 Pro 256GB - $194.99  2 of these one for system and another for media cache, previews, and exports.
    Am I forgetting anything?
    Thanks for taking a look

  • Please Help! Sound is stopping in every 5 seconds until volume level is changed.

    I have G60-535DX model and recently I came across a strange problem. Sound of my laptop speaker works fine for 5 seconds and then stops. When I change the volum level either from task bar volume icon or through keyboard shortcut it starts playing again for next 5 seconds. Please note that it has no issue with headphones. 
    I have used windows troubleshooting wizard, checked in device manager, drivers are up-to-date. Could you please post the solution for it?

    Please reply with solution as its very annoying issue

  • Please Help: Automator to get text from Safari Reader into Text file

    Hello All,
    I was hoping that someone will be able to help me.
    I would like for automator to obtain article text from a website without me having to manually cut and paste it.
    I tried to put together a workflow to get text from webpage, but it unfortunatley get some information that I don't want for eg. Menu Bar Titles and additional links etc. What would be ideal is if I could only extract the data that shows when I use the Safari Reader function.  I have tried a jave Readability Script, but this also extract the same information. Is there anyway someone could please kindly help me out with a nice Applescript or something?
    If there is no way to do this, there could be another solution around this... if there was a way I could use automator to delete the first and last 10 lines of the text document.
    Again, any help will be much appreciated.
    Many thanks,
    VicandMeliJvR

    Hi David,
    Thank you for your feedback. I would be happy to use a screen capture program, but Quicktime X seems to only allow me to record audio and record the video separately. I will do this as a last resort, but it's a big pain to try to line up the video audio.
    Thank you! I will definitely do this if nothing else works.

  • PLEASE Help. Green Screen in Video Playback and all Video Files.

    Hello to who ever can help a hand out. I feel very stressed by this whole problem. I have a documentary movie that has been finished and edited. I only had to add a couple more parts to it to finalize the film. However when i went on my computer today, (last time being last week. Where everything had worked properly) all the video playback is green. it has audio of all the video files, but the video shows up green in the playback and the viewer. Any idea what could have happened. (last week i added a 5 jpegs thats it!)
    Please anybody with any suggestions, I would be very greateful.

    Lots of folks with similar problems. Do your clips play ok in Quicktime Player ? have you done any updates lately.
    Try this thread.
    https://discussions.apple.com/thread/5492686?start=0&tstart=0
    DM

  • Please help me solve--REP 1804 unable to open printer definition file 'dflt

    Kindly help me solve this error.Im a novice and trying to generate a report but this error REP 1804 unable to open printer definition file 'dflt' comes up...

    Good morning,
    Reports is trying to open the default printer defined on the system. Are you running this in Report Designer? or is it running on the Report Server. If you are running in Report Designer on your own PC, check the default printer on your system. If you are running on the Report Server, check the default printer defined on the server.
    Don.
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! :)

  • Please help. I can't email or open an ai file

    Hello,
    I have an online design class deadline for illustrator cs3. i created a jpg file and saved it as save for web. this was semi successful.
    I then took the same high resolution jpg document and saved it as the apparent original, ".ai" file. ***For some reason, I am unable to open this CS3 ai file when I send it via email. I can open the file no problem on my mac desktop, but it just does not post on a discussion board or open in gmail. It says that the script is not readable or something, and something about a pdf file. For my class, i am definitely supposed to post an original adobe illustrator file to a discussion board.
    I have read that gmail does not accept large files. perhaps this is the problem. anyways, any advice would be great. i dont know how to create a zip, compressed file etc if I need to do this.
    my assignment for a design class asked for an illustrator document of 12 inches by 12 inches. I created this new document for the web. is there anything else that i should have checked when saving it as an illustrator (ai) document?
    I will be happy to check on the file size, if necessary.
    thanks,
    clueless

    Files sent via email should be compressed first. Right-click on the file and choose
    Compress "[filename]" (Leopard) or
    Create Archive of '[filename]" (Tiger). Email that file.
    If you export a JPEG, then open that, you will only be able to see the rasterized art. You will not have access to the original Adobe Illustrator file that created that image. There is almost certainly no reason for you do do this if the recipient (i.e. you) has Illustrator, too.

Maybe you are looking for

  • Saving to a folder that is password protected

    I've got a script that saves artwork to a public folder but I also need a script that saves the artwork to a folder that is password protected.  The username and password is something I would need illustrator to be able to type in before saving is th

  • My excel report is not working in executable file ,however,it works well in vi

    Hi all ,      Could any one please help me in getting the reason behind the executable file not working for excel report generation,however I can get the same function without any problem in main vi. I am attaching my code and executable file also ,p

  • How much HD space do i need to backup computer?

    I am new to mac's and just wondering how much room i will need approx. to backup my computer? thanks

  • Firmware upgrade query

    Hi Guys, Is there a newer firmware version for my N70? I currently have: V 5.616.2.0.3 24-04-06 RM-84 Thanks in the future "Only two things are infinite, the universe and human stupidity" Previous phones:5110,3210,6210,5210,7650,6600,3660,7610 Curren

  • Grinding Noise, then Beep, then white screen now No Mac.

    Hi IF YOU WANT A QUICK SUMMARY, PLEASE GO TO THE BOTTOM! Yesterday evening I was running my mac, and though it was running quite hot, it wasn't as much as it has been before, and I wasn't particularly concerned by the temp. The next thing I know i st