Text File Slicer
World's simplest file tool
This is a free browser-based utility that slices files with textual data. You can specify the start and end positions of the slice and get a snippet of any length. You can also slice several lines of a file at once and reverse the order of characters in the extracted snippets. Created by computer geeks at team Browserling.
Check out our primary project!
Browserling
We created Browserling – get a cloud browser in 5 seconds. Check it out!
A link to this tool, including input, options and all chained tools.
Can't convert.
What is a Text File Slicer?
learn more about this tool
This online program extracts character chunks from a textual file. You can control the size of a file slice in the options via the slice-start and slice-end parameters. The start and end points of the slice correspond to the character position in the file and both ends are included in the extracted fragment. For example, if the uploaded file contains one word "incredible", then the range [2, 5] will return the string "ncre". If the text data is lengthy and it's difficult to determine the position of the ending character, then you can use negative positions, which count characters from the end of the file. For example, the range [3, -2] will return the string "credibl". If you need a fragment from a specific point to the end of the file, then you can omit the slice-end value. For example, the range [3, ] will return the string "credible". Similarly, if you need a piece of data from the beginning of the file to some specific end point, then you can skip the slice-start value. For example, the range [ , -3] will return the string "incredib". If the file content has many lines, then you can apply the slicing algorithm to every single line in the file. By activating the "Slice File Lines Separately" option, the application will return a slice of each separate line. As an additional feature, you can reverse characters in the extracted fragments. Filabulous!
Text File Slicer examples
Click to useSherlock Holmes Quote
In this example, Sherlock Holmes sent us a file with his newest quote and asked us to extract the most important part from it. To do this, we used our text file slicer and entered the character range from 5 to 35. The extracted fragment is 31 characters long and reads as "world is full of obvious things".
The world is full of obvious things which nobody by any chance ever observes. Sherlock Holmes
world is full of obvious things
Required options
Slice start.
Slice end.
Apply the slicing algorithm
to each individual file line.
When a slice is extracted,
reverse characters in it.
Harry Potter Books
In this example, we load a file that contains a list of seven books in the Harry Potter series. Each fantasy novel is printed on a new line and has the same title fragment at the beginning that says "Harry Potter and ...". We want to focus only on the ending part of the book name, so we slice the titles starting from the 22nd symbol to the final symbol of the line. To slice all titles simultaneously, we enable the separate line slicing option and get the ending parts of all seven books.
Harry Potter and the Philosopher's Stone
Harry Potter and the Chamber of Secrets
Harry Potter and the Prisoner of Azkaban
Harry Potter and the Goblet of Fire
Harry Potter and the Order of the Phoenix
Harry Potter and the Half-Blood Prince
Harry Potter and the Deathly Hallows
Philosopher's Stone
Chamber of Secrets
Prisoner of Azkaban
Goblet of Fire
Order of the Phoenix
Half-Blood Prince
Deathly Hallows
Required options
Slice start.
Slice end.
Apply the slicing algorithm
to each individual file line.
When a slice is extracted,
reverse characters in it.
Slice and Reverse
In this example, we decided to demonstrate the remaining features of this web application and in addition to slicing the file, we also reverse the characters in the extracted pieces. The loaded file contains a quote from the Finding Nemo adventure film. We slice it from the beginning (start slice option is empty) to position -16 (which means 16 characters from the end of the file) and then we reverse all symbols.
"Just keep swimming" – Finding Nemo
"gnimmiws peek tsuJ"
Required options
Slice start.
Slice end.
Apply the slicing algorithm
to each individual file line.
When a slice is extracted,
reverse characters in it.
Pro tips
Master online file tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinefiletools.com/slice-text-file?input=The%20world%20is%20full%20of%20obvious%20things%20which%20nobody%20by%20any%20chance%20ever%20observes.%20Sherlock%20Holmes&start=5&end=35&multi-line=false&reverse=false
All file tools
Quickly generate a random text file of any size.
Quickly generate a random binary file of arbitrary size.
Quickly generate an empty file with any extension.
Quickly shorten a text file to the given number of bytes.
Quickly extract a fragment of a certain size from a text file.
Quickly simulate data corruption in a text file.
Coming soon
These file tools are on the way
Edit a File
Load a file in a browser-based file editor.
Detect File Type
Find the exact type of the given file.
Create a Custom File
Create an arbitrary file of arbitrary size with arbitrary content.
Extract a File Fragment
Extract a byte range between start and end positions.
Zip Compress a File
Compress a file using the zip compression algorithm.
Uncompress a Zip File
Unzip a .zip file and extract its content.
Recompress a Zip File
Recompress a zip archive without extracting it.
Split a Zip into Pieces
Create a multi-file zip archive from the given archive.
Add a Comment to a Zip File
Add a hidden comment or a secret message in a zip file.
RAR Compress a File
Compress a file using the RAR compression algorithm.
Uncompress a RAR File
Unrar a .rar file and extract its content.
Recompress a RAR File
Recompress a rar archive without extracting it.
Gzip Compress a File
Compress a file using the gzip compression algorithm.
Gunzip a File
Uncompress a .gz file and extract its content.
Bzip2 Compress a File
Compress a file using the bzip2 compression algorithm.
Bunzip2 a File
Uncompress a .bz file and extract its content.
Xz Compress a File
Compress a file using the xz compression algorithm.
Unxz a File
Uncompress an .xz file and extract its content.
Lzma Compress a File
Compress a file using the LZMA compression algorithm.
Unlzma a File
Uncompress an .lzma file and extract its content.
Tar a File
Create a tarball with the given files.
Untar a File
Extract the contents of a .tar archive.
Base32 Encode a File
Convert a file to base32 encoding.
Base32 Decode a File
Create a file from base32 encoding.
Base64 Encode a File
Convert a file to base64 encoding.
Base64 Decode a File
Create a file from base64 encoding.
URL Encode a File
Convert a file to URL encoding (percent encoding).
URL Decode a File
Create a file from URL encoded data (percent encoded data).
Convert a File to HTML Entities
Encode a file to HTML.
Convert HTML Entities to a File
Create a file from HTML entities.
Merge Files
Join multiple files together.
Create a High Entropy File
Generate a file that has high entropy.
Create a Low Entropy File
Generate a file that has low entropy.
Generate a Small File
Create a relatively tiny binary or text file (useful for testing).
Generate a Big File
Create a relatively large binary or text file (useful for testing).
Generate a Single Byte File
Create a file with any extension that contains just one byte.
Create a File from Bytes
Given a list or an array of bytes, create a file from them.
Split a File
Split a file in chunks of certain size.
Reverse a File
Reverse the order of bytes in a file.
Change File Endianness
Swap bytes in a file to change its endianness.
Shuffle Bytes in a File
Randomly change the order of bytes in a file.
Pick Bytes from a File
Randomly select one or more bytes from the given file.
Damage a File
Introduce random errors in a binary file.
Shred a File
Overwrite the given file repeatedly with random bytes.
Randomly Flip Bits in a File
Corrupt data by flipping one or more bits in the given file.
Randomly Replace Bytes in a File
Corrupt a file by randomly replacing byte values in a file.
Randomly Delete Bytes from a File
Corrupt a file by removing one or more bytes at random positions.
Remove Bytes from a File
Delete certain bytes from a file.
Change Bytes in a File
Replace bytes in a file.
Clamp Bytes in a File
Limit the range of byte values in a file.
Increment Bytes in a File
Increment every byte in a file by one (or more).
Decrement Bytes in a File
Decrement every byte in a file by one (or more).
Left-pad a File
Pad a file with bytes on the left.
Right-pad a File
Pad a file with bytes on the right.
Zero-fill a File
Change all bytes in a file to zeros.
Rotate a File
Rotate bytes in a file to the left or to the right.
Shift a File
Shift bytes in a file to the left or to the right.
Mirror a File
Create a mirror copy of the given file.
Create a Symmetric File
Create a palindromic file from the given file.
Interleave Two Files
Merge two (or more) files byte by byte.
Create Random Bytes
Generate a list of random bytes.
Analyze a File
Print information about a file.
Display a Hex Dump of a File
Print a hexadecimal view of the data in a file.
Convert Hex Bytes into a File
Create a binary file from the given hex bytes (in ASCII).
Display a Binary Dump of a File
Print a binary view of the data in a file.
Convert Binary Bits into a File
Create a binary file from the given binary bits (in ASCII).
Find File Size
Find the size of any file in bytes/kilobytes/megabytes.
Rename a File
Set a new filename for the given file.
Zalgo a File
Let Zalgo destroy your file.
Subscribe!
Never miss an update
Cool!
Notifications
We'll let you know when we add this tool
Cool!