am trying to select from a fastq file only the first 10 nucleotides of the reads:  Input:@RONSP:03887:07268GTAGTTATCTGAAAGGATGCATGGGAAAATTTCAATATTTTTGTATCTGTTGAGGACTTTTTTGTGAGTGACTATATGGTCAATTTTGGAGGATTTGGTACTGAG  +  69;::5:<<<<<<3<5<<<;:67717<=0@@9;:5::;;;?-;::::;;;5=;;5:888777)79:::;A;;;<<<<<7<::5:;=/706:5:<=3;5;;;<;;:  @RONSP:09389:11828 GTGTGTCTCTGTTCAGTTTCTGCTTCCAGGATCTGTCTCTTGGTGAGAGTGTGGTCTTGAAGTCTCCCAGTATTATTTTATGAGGTGCAATGTGTGCTTTGATCTTTAGCAAAGTGTATTTAATGAATGTGGCTGCTCTTGCATTTAGAGCATAGACATTCAGAATTGAG  +  8:::<<<<;<;;5;;:;;1;;?::4:5:;5888::<;<<<6<6<>?;;;;;DD7?=D5<;6<<=<>=4><==<5<<<<0<<<AA7<<;;5=>==<<:::0:<>666+599990999::<<193944.42421443668849:88919;;;;;<<;;<9928;=;5<4:9:  Output:@RONSP:03887:07268GTAGTTATCT +  69;::5:<<<  @RONSP:09389:11828GTGTGTCTCT+  8:::<<<<;< Most of the tools trim starting from the end of the reads. But I need just the first 10 nucleotide of the reads.Any idea is really appreciated.
Take the first 10 characters of strings in a fastq file
text processing;awk;sed;bioinformatics
$ sed -E '/^[^@+]/s/^(.{10}).*$/\1/' fastqThis will perform a substitution on all lines not beginning with @ or +.  The substitution will replace the whole line with only the first 10 characters on the line.Alternative formulation:$ sed -E 's/^([^@+].{10}).*$/\1/' fastq