#!/bin/bash

# Iterate over all files in the current directory
for file in *; do
  # Check if it is a regular file and not a directory
  if [[ -f "$file" ]]; then
    # Get the filename without the extension
    folder_name="${file%.*}"
    
    # Create the new directory if it doesn't exist
    mkdir -p "$folder_name"
    
    # Move the file into the new directory
    mv "$file" "$folder_name/"
    
    echo "Moved '$file' to '$folder_name/'"
  fi
done
